<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">

    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <title>我的红包</title>
    <link rel="stylesheet"  href="src/css/base.css?__version=3.3">
    <link rel="stylesheet"  href="src/css/pages.css?__version=3.3">
    <script type="text/javascript" src="src/js/jquery-1.10.1.min.js?__version=3.3"></script>
    <script type="text/javascript" src="src/js/dropload.js?__version=3.3"></script>
    <script type="text/javascript" src="src/js/init.js?__version=3.3"></script>
</head>
<body>
	<div class="init_content" style="display: none;">
	    <div class="warp myred_warp" style="top:3.6rem;">
	    	<ul class="myred_list" id="myred_list">
	    		
	    	</ul>
	    </div>
	</div>
    <div class="init_loading">
        <img src="src/img/page_loading.gif">
    </div>
</body>
<script>
	addheader("我的红包","/personal.html")
	
	function getRedbackList(){
		$.ajax({
	        type:"post",
	        url:api_url+'/OpenAPI/V1/User/getRedbackList',
	        jsonp:'callback',
			dataType:'jsonp',
	        data:{'token':token},
	        success:function(data){
	            console.log(data)
	            var Li='';
	            var list=data.data;
	            if(list.length>0){
					for(var i=0;i<list.length;i++){
						var type=list[i]['type']==1?'抵用红包':"满减红包"
						Li+='<li>'
				    			+'<img class="myred_img" src="src/img/myred_icon.png">'
				    			+'<div class="myred_right">'
				    				+'<div class="top">'
				    					+'<span>'+list[i]['title']+'</span>'
				    					+'<a class="btnuse" href="/recharge.html?red_id='+list[i]['back_red_id']+'">立即使用</a>'
				    				+'</div>'
				    				+'<div class="bottom">'
				    					+'<span class="money">¥'+list[i]['coin']+'</span>'
				    					+'<span class="time">有效期：'+list[i]['term_at']+'</span>'
				    				+'</div>'
				    			+'</div>'
				    		+'</li>'
					}
				}else{
					Li+='<li style="color:#666;text-align:center;padding-top:100px;font-size:16px;border:0;">暂无可用红包</li>'
				}
				$("#myred_list").html(Li);
		        }
	    })
	}
	$(function(){
		getRedbackList();
	})
	
</script>
</html>